<template>
  <main>
    <a-btn>返回</a-btn>
    <div>{{ info.title }}</div>
    <div>{{ info.content }}</div>
  </main>
</template>

<script setup lang="ts">
  import { useRoute } from 'vue-router';
  import { onMounted, ref } from 'vue';
  import { getMsg } from '@/api/user';

  const route = useRoute();
  const info = ref({
    title: '',
    content: '',
  });

  onMounted(async () => {
    const id = route.params.id;
    const params = {
      page: 1,
      pageSize: 20,
      id: id,
    };
    const data = await getMsg(params);
    info.value = data;
  });
</script>
